package com.gcxy.dto.semester;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.gcxy.constant.StringConst;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * Copyright (C), 2024-2024, BUG闭退！
 * Author: Huang先森
 * Date: 2024/7/25 10:32
 * FileName: SemesterInfoDTO
 * Description:
 */
@Data
public class SemesterInfoDTO {

    @ApiModelProperty("主键id")
    private Integer id;

    @NotBlank(message = "学期名称不能为空")
    @Length(max = 20, message = "学期名称不能超过20个字符")
    @ApiModelProperty("学期名称")
    private String name;

    @NotNull(message = "学期开始时间不能为空")
    @ApiModelProperty("学期开始时间")
    @JsonFormat(pattern = StringConst.FORMAT_STRING)
    private LocalDateTime startTime;

    @NotNull(message = "学期结束时间不能为空")
    @ApiModelProperty("学期结束时间")
    @JsonFormat(pattern = StringConst.FORMAT_STRING)
    private LocalDateTime endTime;
}
